﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace FluentResourceMapping.AutoMapping
{
    public class AutoMap
    {
        public static AutoResourceMappingModel AssemblyOf<T>()
        {
            return AssemblyOf<T>(new DefaultAutomappingConfiguration());
        }

        public static AutoResourceMappingModel AssemblyOf<T>(IAutomappingConfiguration automappingConfiguration)
        {
            IEnumerable<Type> types = typeof (T).Assembly.GetTypes();

            AutoResourceMappingModel autoResourceMappingModel = new AutoResourceMappingModel(types,
                                                                                             automappingConfiguration);

            return autoResourceMappingModel;
        }
    }
}